<template>
    <div>
        <h1 @click="jumpPage">新闻页面</h1>
        <button type="" @click="jump2">name跳转</button>
        <router-link :to="{name:'home'}">跳转home</router-link>
        <button @click="jump3">动态路由</button>
    </div>
</template>

<script>
export default {
    name:'News',
    data() {
        return {
            
        }
    },
    created() {
        console.log(this.$route);
        console.log(this.$route.params);
        console.log(this.$route.query);
    },
    methods: {
        jumpPage(){
        this.$router.go(1)
    },
    jump2(){
        this.$router.push({
            name:'about'
        })
    },
    jump3(){
        this.$router.push({
            //动态路由的方式
            // path:'/lesson/200'
            // path:'/lesson/'+200
            name:'lesson',
            params:{
                id:123
            }
        })
    },
    },
}
</script>
<style lang="scss">
    
</style>